﻿using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows;
//using static System.Net.Mime.MediaTypeNames;

namespace 在源代码中启动主窗体
{
    class App
    {
        [STAThread]
        static void Main()
        {
            Application app = new Application();
            //方法1
            MainWindow win = new MainWindow();
            app.Run(win);

            //方法2：
            //指定Application对象的MainWindow属性为启动窗体，然后调用无参数的Run方法  
            //MainWindow win = new MainWindow();
            //app.MainWindow = win;
            ////是必须的，否则无法显示窗体   
            //win.Show();
            //app.Run();

            //方法3
            //app.StartupUri = new Uri("MainWindow.xaml", UriKind.Relative);
            //app.Run();
        }
    }
}
